It is a phrase for "of little value or benefit". It is very old and the origin is not known, although there was another as "[sandwich] of two cheese and one bread" that may have some relationship.
look bad